﻿using Algorithms;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace GeneticAlgorithmTests
{

    [TestClass]
    public class QuickSortStrategyTest
    {
        [TestMethod]
        public void QuickSort_Sorts_Correctly()
        {
            QuickSortStrategy target = new QuickSortStrategy(); 
            Genome[] generation = new[] { new Genome(1), new Genome(3), new Genome(2) }; 
            double[] fitnessTable = new[] { 0.1, 0.5, 0.2 }; 
            target.Sort(generation, fitnessTable);

            Assert.IsTrue(generation[0].Length < generation[1].Length && generation[1].Length < generation[2].Length);
            Assert.IsTrue(fitnessTable[0] < fitnessTable[1] && fitnessTable[1] < fitnessTable[2]);
        }
    }
}
